//
//  RootView.m
//  UI4_Delegate4
//
//  Created by dllo on 15/11/11.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "RootView.h"

@implementation RootView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    self.backgroundColor = [UIColor yellowColor];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(50, 50, 50, 50);
    button.backgroundColor = [UIColor redColor];
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:button];



}


- (void)buttonAction:(UIButton *)sender
{
    [self.delegate changeVCColor];
}


@end
